﻿using OddUserManager.Model;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.Threading.Tasks;

namespace OddUserManager.Web.Models
{
    /// <summary>
    /// 竞彩测试过滤参数集合（整合所有策略组的）
    /// </summary>
    public class JCTestSimpleObjectParams
    {

        public JCTestSimpleObjectParams()
        {
            SelectedLeagues = new Dictionary<string, List<string>>();
            SelectedMatchObjects = new Dictionary<MatchFixOdds, List<string>>();
            SelectedFilterOdds = new List<JCDetailOddFilteSetting>();
        }
        public Dictionary<string, List<string>> SelectedLeagues { get; set; }

        public Dictionary<MatchFixOdds, List<string>> SelectedMatchObjects { get; set; }

        public List<JCDetailOddFilteSetting> SelectedFilterOdds { get; set; }

        public DateTime StartTime { get; set; }
        public DateTime EndTime { get; set; }

        public int MinPayReturn { get; set; }
        public int MaxPayReturn { get; set; }
    }

    public class JCDetailOddFilteSetting
    {
        public int Id { get; set; }
        public decimal MinValue { get; set; }
        public decimal MaxValue { get; set; }
        public int ParentId { get; set; }
    }

    [Serializable]
    public class JCResultAndOdd
    {
        public string FixOdd { get; set; }
        public string Result { get; set; }
        public decimal Odd { get; set; }
        public decimal PayReturn { get; set; }

        public object Clone()
        {
            BinaryFormatter formatter = new BinaryFormatter(null, new System.Runtime.Serialization.StreamingContext(System.Runtime.Serialization.StreamingContextStates.Clone));
            MemoryStream stream = new MemoryStream();
            formatter.Serialize(stream, this);
            stream.Position = 0;
            object clonedObj = formatter.Deserialize(stream);
            stream.Close();
            return clonedObj;
        }
    }



    public class JCLotteryBillSelectedMatchsTest
    {
        public JCLotteryBillSelectedMatchsTest()
        {
            ResultList = new List<JCLotteryBillSelectedMatchResultsTest>();
        }
        public int Id { get; set; }
        public int JCLotteryBillId { get; set; }
        public string TestNumber { get; set; }
        public string LeagueName { get; set; }
        public string SelectedMatchId { get; set; }
        public string SelectedGameNumber { get; set; }
        public List<JCLotteryBillSelectedMatchResultsTest> ResultList { get; set; }
    }
    public class JCLotteryBillSelectedMatchResultsTest
    {
        public int Id { get; set; }
        public int JCLotteryBillSelectedMatchsTestId { get; set; }
        public string FixOdds { get; set; }

        public string SelectedResult { get; set; }
        public decimal SelectedOdds { get; set; }
        public decimal SelectedPayOut { get; set; }
        public int DetailsOddCount { get; set; }


        public int CoefficientOfStrategy { get; set; }
        public int Reliability { get; set; }

    }
}
